# 导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

# 获取浏览器驱动
driver = webdriver.Firefox()
# 1.最大化窗口
driver.maximize_window()
# 打开测试的网址
# url = 'file:///C:/Users/tedu/Desktop/NSD2407/html/registerA.html'
url = 'https://www.samsung.com.cn/'
driver.get(url)
# 2.设置窗口的尺寸
sleep(3)
driver.set_window_size(400, 1000)
# 3.调整窗口位置
sleep(3)
driver.set_window_position(760, 0)
# 点击个人中心按钮
sleep(3)
driver.find_element(By.XPATH, '//*[@id="component-id"]/div[1]/div[2]/div[5]/div[3]/a').click()
# 4.后退操作
sleep(3)
driver.back()
# 5.前进操作
sleep(3)
driver.forward()

# 停顿3秒，关闭浏览器
sleep(3)
driver.quit()